/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package controller.Actions;

import controller.Forms.LoginForm;
import dao.UserDAO;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import model.User;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

/**
 *
 * @author Adriano
 */
public class CheckUserByEmailAction extends Action {
            
    @Override
    public ActionForward execute(ActionMapping mapping,
            ActionForm form,
            HttpServletRequest request,
            HttpServletResponse response) throws Exception {
        try {

            LoginForm uf = (LoginForm) form;
            User u = new User();
            u.setEmail(uf.getTxtLogin());
            UserDAO uDao = new UserDAO();
          
          
            uDao.closeDAO();
            
            return null;
           

        } catch (Exception e) {

            System.err.println("LOGIN - " + e.getMessage());
            return mapping.findForward("erroAlias");
        }
    }
}
